package com.ibeeking.found.common.enums.pay;

/**
 * @ClassName: PayTypeEnum
 * @Author ibeeking
 * @Date: 2021/4/14 18:18
 * @Description: TODO
 */
public enum PayTypeEnum {
    WECHATPAY(1l,"微信支付"),
    ALIPAY(2l,"支付宝支付"),
    BANKCARD(3l,"银行卡支付"),
    COUPONPAY(4l,"券支付"),
    CASHPAY(5l,"现金支付"),
    INTEGRATIONPAY(6l,"券支付");

    private Long code;
    private String value;

    PayTypeEnum(Long code, String value) {
        this.code = code;
        this.value = value;
    }

    public Long getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByCode(Long code) {
        for (PayTypeEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getValue();
            }
        }
        return null;
    }
}
